package kr.hkit.powerjava.chapter24.work3;

import java.util.Scanner;


public class ServiceItem<T> {

	protected InterfaceDao<T> dao;
	protected Scanner sc;
	
	public ServiceItem(InterfaceDao<T> dao, Scanner sc) {
		this.dao = dao;
		this.sc = sc;
	}
	public ServiceItem(InterfaceDao<T> dao) {
		this.dao = dao;
		init();
	}

	private void init() {
		dao.loadFile();
		prnMenu();

	}

	private void prnMenu() {
		System.out.println("1.입력\n2.삭제\n3.수정\n4.검색\n5.리스트보기\n6.종료");
		int res =sc.nextInt();
		switch(res){
		case 1:
			break;
		case 2:
			dao.prnItemList(null);
			System.out.println("삭제 할 번호를 입력하시오");
			int delNum = sc.nextInt();
			dao.deleteItem(delNum-1);
			break;
		case 3://리스트를 보여주고
			dao.prnItemList(null);
			item = inputStdinfo(true);
			dao.updateItem(std);
			break;
		case 4://검색
			itme = inputStdinfo(false);
			
			break;
		case 5:
			break;
		case 6:
			break;
			dao. 
		default:
	}
	}
	
}
